package com.mi.system.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.mi.system.entity.UserRole;

/**
 * User role service
 *
 * @author jin_huaquan
 * @version 1.0
 * @date 2021/11/1 13:57
 */
public interface UserRoleService extends IService<UserRole> {

    /**
     * save user role
     *
     * @param roleIds role ids
     * @param userId  user id
     * @return result
     */
    boolean saveUserRole(Long[] roleIds, Long userId);

    /**
     * update user role
     *
     * @param roleIds role ids
     * @param userId  user id
     * @return result
     */
    boolean updateUserRole(Long[] roleIds, Long userId);

    /**
     * remove user role
     *
     * @param userId user id
     * @return result
     */
    boolean removeUserRole(Long userId);

    /**
     * 判断是否存在该角色的用户角色关联
     *
     * @param roleId 角色ID
     * @return 是否存在
     */
    boolean existUserRole(Long roleId);
}
